using System.Windows;
using System.Windows.Input;
using CommunityToolkit.Mvvm.Input;
using MiniTheme.ViewModels;
using MiniTheme.Services.Interfaces;

namespace MiniTheme.Views;

public partial class MainWindow : Window
{
    public ICommand MinimizeCommand { get; }
    public ICommand MaximizeRestoreCommand { get; }
    public ICommand CloseCommand { get; }

    public MainWindow(MainViewModel viewModel, INavigationService navigationService)
    {
        // 初始化窗口控制命令
        MinimizeCommand = new RelayCommand(() => WindowState = WindowState.Minimized);
        MaximizeRestoreCommand = new RelayCommand(() =>
            WindowState = WindowState == WindowState.Maximized
                ? WindowState.Normal
                : WindowState.Maximized);
        CloseCommand = new RelayCommand(() => Close());

        InitializeComponent();
        DataContext = viewModel;

        // 初始化导航服务
        navigationService.SetNavigationControl(NavigationContentControl);
    }
}